package com.xuezhixin.example.web.serviceImple;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xuezhixin.example.web.dao.BookMapper;
import com.xuezhixin.example.web.model.Book;
import com.xuezhixin.example.web.model.BookExample;
import com.xuezhixin.example.web.service.BookService;

@Service
public class BookServiceImple  implements BookService{

	
	@Resource
	BookMapper bookMapper;
	
	public List<Book> selectList() {
		BookExample bookExample=new BookExample();
		return bookMapper.selectByExample(bookExample);
		
	}

	public List<Book> selectByModel(Book book) {
		return  bookMapper.selectByModel(book);
	}

	public void insert(Book book) {
		bookMapper.insert(book);
	}

	public void delete(Book book) {
		bookMapper.deleteByPrimaryKey(book.getBookId());
	}

	
	
}
